<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<style type="text/css">
	.has-error .form-control {
	    border-color: #ccc;
	}
</style>
<form id="addOrEditForm" method="post">
	<table class="form-table">
		<tr class="hidden"><td>
			<input name="dto.apiInterface.interfaceId" />
			<input name="dto.apiInterface.taskId" />
			<input name="dto.apiInterface.moduleId" />
			<input name="dto.apiInterface.moduleNum" />
			<input name="dto.apiInterface.createTime" />
			<input name="dto.apiInterface.status" />
			<input name="dto.apiInterface.execSuccessCnt" />
			<input name="dto.apiInterface.execFailCnt" />
			<!-- <input name="dto.apiInterface.authorName" /> -->
		</td></tr>
		<tr>
			<td style="text-align:right">请求地址：</td>
			<td><input id="requestMethod" name="dto.apiInterface.requestMethod" style="width:100px"/></td>
			<td><input id="protocol" name="dto.apiInterface.protocol" style="width:220px"/></td>
			<td><input id="url" class="exui-textbox" name="dto.apiInterface.url" style="width:330px" data-options="required:true"/></td>
			<td style="padding-left:10px">
				<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="saveOrSend(1)">发送</a>
				<a class="exui-linkbutton" data-options="btnCls:'success-outline',size:'xs'" onclick="saveOrSend()">保存</a>
			</td>
		</tr>
		<tr>
			<td style="text-align:right">接口名称：</td>
			<td colspan="3"><input class="exui-textbox" name="dto.apiInterface.interfaceName" style="width:650px"/></td>
		</tr>
		<tr>
			<td style="text-align:right">接口描述：</td>
			<td colspan="3"><input class="exui-textbox" name="dto.apiInterface.description" style="width:650px" data-options="required:true"/></td>
		</tr>
		<tr>
			<td style="text-align:right">请求数据类型：</td>
			<td colspan="3">
				<input id="dataType" name="dto.apiInterface.dataType" style="width:275px"/>
				<span style="padding-left: 20px">响应数据类型：</span>
				<input id="contentType" name="dto.apiInterface.contentType" style="width:233px"/>
			</td>
		</tr>
		<tr>
			<td></td>
			<td colspan="3">
				<div class="exui-tabs" data-options="width:650,onSelect:onTabsSelect" id="tabsPage" style="margin:5px 0">
					<div title="请求参数" style="padding:10px">
						<div style="margin-bottom: 2px;">
							<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="addRow()"><i class="glyphicon glyphicon-plus"></i> 新增</a>
							<a class="exui-linkbutton" data-options="btnCls:'inverse',size:'xs',text:'编辑器模式'" onclick="modeSwitch(this)"></a>
							<a class="exui-linkbutton" data-options="btnCls:'gray',size:'xs',text:'json美化'" onclick="prettyJson()" style="display: none;"></a>
						</div>
						<span id="paramsDgWrap"><table id="paramsDg" class="exui-datagrid"></table></span>
						<span id="paramsJsonWrap" style="display: none;"><input id="paramsJson" class="exui-textbox" style="width:627px;height:120px" data-options="
							multiline: true,
							prompt: '参数可以通过如下两种方式进行添加\n批量添加：每行一个key:value\nJSON格式：以json格式书写参数'
						"/></span>
					</div>
					<div title="请求头" style="padding:10px">
						<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="addRow()" style="margin-bottom: 2px;"><i class="glyphicon glyphicon-plus"></i> 新增</a>
						<table id="headerDg" class="exui-datagrid"></table>
					</div>
					
					<div title="断言" style="padding:10px" id="assertWin">
					<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="assertFunction()" id="assertEdit" style="margin-bottom: 2px;" >拖拽式维护断言 </a>
						<table id="assert">
							<tr>
								<td colspan="3">
									<textarea rows="4" cols="6" name="dto.apiInterface.validExpress" style="width:628px;height: 200px;resize:none;border: 1px solid #d6cece;" id="validExpress" placeholder="设置相关参数，点击发送之后，进入断言界面可进行可视化的拖拽"></textarea>
								</td>
							</tr>
						</table>
					</div>
					<!-- <div title="认证方式">
						<input class="exui-combobox" name="dto.authType" style="width:250px" data-options="
							editable:false,
							valueField:'value',
							textField:'label',
							data: [{
								label:'基础认证',value:1
							}, {
								label:'token认证',value:2
							}],
							prompt:'-请选择-'"/>
					</div> -->
				</div>
			</td>
		</tr>
		<tr>
			<td valign="top" style="text-align:right">响应：</td>
			<td colspan="3"><pre id="respResult" style="width:650px"></pre></td>
		</tr>
	</table>
</form>

<!-- <div id="paramsTb">
	<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="addRow()"><i class="glyphicon glyphicon-plus"></i> 新增</a>
	<a class="exui-linkbutton" data-options="btnCls:'inverse',size:'xs',text:'编辑器模式'" onclick="modeSwitch(this)"></a>
	<a class="exui-linkbutton" data-options="btnCls:'gray',size:'xs',text:'json美化'" onclick="prettyJson()" style="display: none;"></a>
</div>
<div id="headerTb">
	<a class="exui-linkbutton" data-options="btnCls:'primary',size:'xs'" onclick="addRow()"><i class="glyphicon glyphicon-plus"></i> 新增</a>
</div> -->
<input id="assertId" type="hidden" />
<input id="isJsonE" type="hidden" />
<script src="<%=request.getContextPath()%>/itest/js/apiManager/interfaceManager/editInterface.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=request.getContextPath()%>/itest/js/apiManager/interfaceManager/common.js" type="text/javascript" charset="utf-8"></script>